<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <title>打印</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link href="../../css/style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<script src="../../js/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="../../js/JPageController.js" type="text/javascript"></script>
<script src="../../js/comm.js" type="text/javascript"></script>
<script src="../../js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="../../js/util.js" type="text/javascript"></script>
<script src="../../js/JBusinessCom.js" type="text/javascript"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td valign="top" class="main">

            <div class="clear height10"></div>
            <div class="shadowBoxWhite whiteBox fl" style="width: 765px; margin: 0 auto;">
                <div class="title">选择打印模板并打印</div>
                <div style="padding: 10px;">
                    <a target="_blank"
                       href="" onclick="onPrint('SaleDetail1.grf')"
                       class="printButton shadowBoxWhite A4"><span>A4</span></a>
                    <a target="_blank"
                       href="" onclick="onPrint('SaleDetail.grf')"
                       class="printButton shadowBoxWhite others"><span class="title">套打</span><span class="text">241*93MM</span></a>
                    <a target="_blank"
                       href="" onclick="onPrint('SaleDetail140.grf')"
                       class="printButton shadowBoxWhite others"><span class="title">套打</span><span class="text">241*140MM</span></a>
                    <a target="_blank"
                       href="" onclick="onPrint('SaleDetail190.grf')"
                       class="printButton shadowBoxWhite others"><span class="title">套打</span><span class="text">190*130MM</span></a>
                    <a target="_blank"
                       href="" onclick="onPrint('SaleDetail_POS.grf')"
                       class="printButton shadowBoxWhite others"><span class="title">小票打印</span><span
                            class="text">88MM</span></a>
                    <a target="_blank"
                       href="" onclick="onPrint('custom/SaleDetail1.grf')"
                       class="printButton shadowBoxWhite custom"><span class="title">自定义</span></a>
                </div>
                <div class=" clear height10"></div>
                <div class="title">设计打印模板</div>
                <div class="" style="display: block; text-align: center; padding: 10px 0;">
                    以
                    <select id="selTemp" class="inputSelect">
                        <option value="sys;SaleDetail1.grf">A4纸打印</option>
                        <option value="sys;SaleDetail.grf">套打(241*93MM)</option>
                        <option value="sys;SaleDetail140.grf">套打(241*140MM)</option>
                        <option value="sys;SaleDetail190.grf">套打(190*130MM)</option>
                        <option value="sys;SaleDetail_POS.grf">小票打印(88MM)</option>
                        <option value="user;SaleDetail1.grf">自定义模板</option>
                    </select>
                    为基础
                    <a target="_blank" onclick="Design(this)" class="button" href="">设计</a>
                </div>
            </div>


            <script type="text/javascript">
                function Design(obj) {
                    try{
                        p_data="Busi=Sale!Type=" +
                                $("#selTemp").val().split(';')[0] + "!ReportGrf=" +
                                $("#selTemp").val().split(';')[1] + "!DataUrl=/PrintReportData/PrintSaleDetail";
                        parent.common_bi.putParam(sale_id+'_design',p_data);
                        p_url="HomePage/DesignReport.html?SaleId="+sale_id;
                        parent.childAddTab('打印模板设计', p_url , '慧管货');
                        parent.$('#openPrintDiv').dialog('close');
                    }catch(e){
                        alert(e)
                    }
                }
            </script>

        </td>
    </tr>
</table>
<script type="text/javascript">
    var sale_id=requestUrlPara('SaleId');
    $(document).ready(function () {
        //eval("");
        parent.$("#divLoading").hide();
        var errMsg = $(".validation-summary-errors").text();
        if (errMsg) {
            Dialog.alert(errMsg);
        }
    });

    function AjaxStart() {
        parent.$("#divLoading").show();
    }
    function AjaxStop() {
        parent.$("#divLoading").hide();
    }

    function onPrint(grf_name){
        var print_url='HomePage/PrintReport.html?SaleId='+sale_id;
        parent.common_bi.putParam(sale_id+'_print','Busi=Sale!Type=sys!ReportGrf='+grf_name);

        parent.childAddTab('打印预览', print_url , '慧管货');
        parent.$('#openPrintDiv').dialog('close');
    }
</script>
</body>
</html>